<!-- 数据信息 -->
<template>
  <div id="dialog-container">
    <el-button type="primary" plain @click="dialogVisible = true">数据信息</el-button>
    <el-dialog v-dialogDrag title="数据信息" append-to-body :visible.sync="dialogVisible" width="720px" :close-on-click-modal="false">
      <!-- <el-button type="primary" plain>导出</el-button> --><br>
      <!-- <h3 style="text-align: center;">设备使用总时间（分钟）</h3> -->
      <h3 style="text-align: center;">设备利用率</h3>
      <br>
      <el-table :data="summaryData" border size="">
        <el-table-column prop="name" align="center" label="设备" min-width="100"></el-table-column>
        <el-table-column prop="occupy" align="center" label="占用总时间" min-width="100"></el-table-column>
        <el-table-column prop="cnt" align="center" label="检测项目数量" min-width="100"></el-table-column>
        <el-table-column prop="workTime" align="center" label="工作总时间" min-width="100"></el-table-column>
        <el-table-column prop="rate" align="center" label="利用率" min-width="100"></el-table-column>
        <el-table-column prop="date" align="center" label="操作" min-width="100">
          <template slot-scope="scope">
            <el-button type="text" @click="detail(scope.row)">查看详情</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-button type="text" style="color: #F56C6C;float: right;">利用率=占用总时间/工作总时间</el-button>
      <look-detail :show.sync="isShowDetail" :currentDevice.sync='currentDevice'></look-detail>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary"  @click="dialogVisible = false">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import LookDetail from './look-detail';
  export default {
    components: {
      'look-detail': LookDetail
    },
    props:['summaryData'],

    data() {
      return {
        currentDevice:{},
        dialogVisible: false,
        isShowDetail: false,
        tableData: []
      }
    },
    methods: {
      detail(row) {
        this.currentDevice=row;
        this.currentDevice.fromDate=this.summaryData.fromDate;
        this.currentDevice.toDate=this.summaryData.toDate;
        this.isShowDetail = true;
      }
    }
  }

</script>
